]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
searchDisplay: Use the rowLimit we pass to the IconGrid
authorChristian Weber <c.weber23@online.de>
Tue, 8 May 2012 20:03:17 +0000 (22:03 +0200)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 3 Jun 2012 05:32:29 +0000 (01:32 -0400)
When displaying children, we need to make sure that we use the rowLimit
property that we pass to iconGrid, rather than assuming that it's
always MAX_SEARCH_RESULTS_ROWS in case some subclass (in an extension maybe)
wants to do something different.

https://bugzilla.gnome.org/show_bug.cgi?id=675527

js/ui/iconGrid.js
js/ui/searchDisplay.js

index ef71bc7a040502c2443b8fb9d00a59215952fd47..79293286866d4e1bb55a5ec0ba43860096363ad0 100644 (file)
@@ -282,6 +282,10 @@ const IconGrid = new Lang.Class({
         return this._computeLayout(rowWidth)[0];
     },
 
+    getRowLimit: function() {
+        return this._rowLimit;
+    },
+
     _computeLayout: function (forWidth) {
         let nColumns = 0;
         let usedWidth = 0;
index fb1ca73e0df522ddb44e4685618f53126f71076d..9ca5198f99d6b07b7ffe16ed4ff1c240b75c3b6b 100644 (file)
@@ -131,7 +131,7 @@ const GridSearchResults = new Lang.Class({
 
     getResultsForDisplay: function() {
         let alreadyVisible = this._pendingClear ? 0 : this._grid.visibleItemsCount();
-        let canDisplay = this._grid.childrenInRow(this._width) * MAX_SEARCH_RESULTS_ROWS
+        let canDisplay = this._grid.childrenInRow(this._width) * this._grid.getRowLimit()
                          - alreadyVisible;
 
         let numResults = Math.min(this._notDisplayedResult.length, canDisplay);